<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
      xmlns:rich="http://richfaces.org/rich">


    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <div class="tituloPagina">
                <h:graphicImage value="/LaCruz_v2/faces/javax.faces.resource/img/report-icon.png" />
                <h:outputText value="#{bundle.ViewItemPedidoFaturamentoTitle}" style="padding-left: 10px" ></h:outputText>
            </div>
        </ui:define>

        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>

            <h:form>
                <br />
                <br />

                <rich:dataTable id="tblFaturamento"  style="width:50%;text-align: center" rows="12" var="ano" value="#{faturamentoController.year}">
                    <f:facet name="header">
                        <rich:columnGroup>
                            <rich:column  colspan="2">
                                <h:outputText value="#{bundle.ViewItemPedidoTitle_ano}" />
                            </rich:column>
                            <rich:column rowspan="1" breakRowBefore="true">
                                <h:outputText value="#{bundle.ViewItemPedidoTitle_mes}" />
                            </rich:column>
                            <rich:column rowspan="1" >
                                <h:outputText value="#{bundle.ViewItemPedidoTitle_faturamento}" />
                            </rich:column>
                        </rich:columnGroup>
                    </f:facet>

                    <rich:column style="text-align: center" colspan="6">
                        <h:outputText value="#{ano}" >
                            <f:convertDateTime pattern="yyyy" />
                        </h:outputText>
                    </rich:column>

                    <rich:collapsibleSubTable var="item" value="#{faturamentoController.items}">

                        <rich:column>
                            <h:outputText value="#{item[0]}">
                                <f:convertDateTime pattern="MMM" />
                            </h:outputText>
                         
                        </rich:column>
                        <rich:column>
                            <h:outputText value="#{item[1]}">
                                <f:convertNumber pattern="R$####.00" />
                            </h:outputText>
                  
                        </rich:column>

                    </rich:collapsibleSubTable>

                    <f:facet name="footer">

                        <!--<rich:columnGroup>
                            <rich:column>Totals</rich:column>
                            <rich:column>
                                <h:outputText value="#{reportBean.expReport.totalMeals}">
                                    <f:convertNumber pattern="$####.00" />
                                </h:outputText>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="#{reportBean.expReport.totalHotels}">
                                    <f:convertNumber pattern="$####.00" />
                                </h:outputText>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="#{reportBean.expReport.totalTransport}">
                                    <f:convertNumber pattern="$####.00" />
                                </h:outputText>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="#{reportBean.expReport.grandTotal}">
                                    <f:convertNumber pattern="$####.00" />
                                </h:outputText>
                            </rich:column>
                        </rich:columnGroup> -->
                    </f:facet>
                    <f:facet name="footer">
                        <rich:dataScroller for="tblFaturamento" maxPages="50" renderIfSinglePage="false"></rich:dataScroller>
                    </f:facet>

                </rich:dataTable>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
